package org.halk.es.crawl.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * 爬取获得的内容
 *
 * @Author halk
 * @Date 2023/3/3 10:31
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@Document(indexName = "content_index", replicas = 0)
public class Content {

    @Id
    private String id;

    /**
     * 标题
     */
    @Field(type = FieldType.Text)
    private String title;

    /**
     * 价格
     */
    @Field(type = FieldType.Long)
    private Double price;

    /**
     * 图片url
     */
    @Field(type = FieldType.Keyword)
    private String imgUrl;
}
